///////////////////////////////////////////////////////////////////
// Student name:Jon Hersack and Caleb Reinking
// Course: COSC 3403
// Assignment: #7 - Initial Software Construction
// File name:Player.java
// Purpose: stores player hand and executes the user's turn.
// Assumptions:none known
// Limitations:turn logic not yet implemented.
// Development Computer:Intel core2 duo 2.67Ghz
// Operating System: windows
// Integrated Development Environment (IDE): netbeans 6.5
// Compiler: Javac: java 1.6.0_13
///////////////////////////////////////////////////////////////////


public class Player
{

    Hand playerHand;
    Boolean humanControlled;
    String name;

    //###########################################
    Player()
    {
        playerHand = new Hand();
        humanControlled = false;
        name = "DefaultPlayerName";
    }// end constructor

    //#############################################
    Player( Boolean humanControl )
    {
        playerHand = new Hand();
        humanControlled = humanControl;
        name = "DefaultPlayerName";
    }// end constructor

    //#############################################
    Hand getHand()
    {
        return playerHand;
    }// end getHand

    //############################################
    void addCard(Card newCard)
    {
        playerHand.addCard(newCard);

    }//end addCArd

    //############################################
    Card playCard(int index)
    {
        if(index>playerHand.size())//out of bounds
            return null;
        else
        {
          Card playedCard = playerHand.removeCard(index-1);
          return playedCard;
        }
    }//end addCArd

    //############################################
    void executeTurn()
    {
        //abstract stub
    }//end executeTurn

    //############################################
    int tryPlay()
    {
        //stub
        return 0 ;
    }//end tryPlay

    //############################################
    int doPlay()
    {
        //stub
        return 0 ;
    }//end doPlay

        //############################################
    String getName()
    {
        //stub
        return name;
    }//end doPlay

    //############################################
    @Override
    public String toString()
    {
        String playerStr = "Player Name: " + name + "\n" +
                           "--------------------------" + "\n";
        for( int i = 0 ; i < playerHand.size() ; i++)
        {
            playerStr += "Card Number " + i + ":  " +
                         playerHand.getCard(i).toStringRep().get(1) +
                         "\n";
        }// end for

        return playerStr;

    } // end toString

}//end class Player
